﻿@model Terminal.Models.CreateUsuario

@{
    ViewBag.Title = "Crear Usuario";
}

@using (Html.BeginForm()) {
    
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Crear Usuario</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.NombreUsuario)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.NombreUsuario)
            @Html.ValidationMessageFor(model => model.NombreUsuario)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Clave)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Clave, new { type = "password" })
            @Html.ValidationMessageFor(model => model.Clave)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ConfirmacionClave)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.ConfirmacionClave , new { type = "password" })
            @Html.ValidationMessageFor(model => model.ConfirmacionClave)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Nombre)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nombre)
            @Html.ValidationMessageFor(model => model.Nombre)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Apellido)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Apellido)
            @Html.ValidationMessageFor(model => model.Apellido)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>

        <div class="editor-label">
            @Html.Label("Empresa")
        </div>
        <div class="editor-field">
            @Html.DropDownList("IdEmpresa", Model.Empresas.Select(e => new SelectListItem{Text = e.Nombre, Value = e.Id.ToString()}))
        </div><br/>

        <p>
            <input type="submit" value="Crear" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Volver", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
